package admrouter

import (
	"github.com/gin-gonic/gin"
	"yundian/internel/app/handlers/pcl/admin/analysishandler"
	"yundian/internel/app/handlers/steward/zmsc/stewardapp"
	"yundian/internel/app/middlewares"
	"yundian/internel/pkg/dingo"
)

func InitAnalysisRouter() dingo.ApiRouter {

	return func(g *gin.RouterGroup) {
		{
			analysisPartner := g.Group("analysis") // 合伙人数据分析
			analysisPartner.Use(middlewares.JwtAuthMiddleware)
			analysisPartner.POST("user-rank-list", analysishandler.HandleGetUserAnalysisList)
			analysisPartner.POST("user-settlement-rank-list", analysishandler.HandleGetUserSettlementAnalysisList)
			analysisPartner.POST("user-income-rank-list", analysishandler.HandleGetUserIncomeAnalysisList)
			analysisPartner.POST("user-team-rank-list", analysishandler.HandleGetUserTeamAnalysisList)
			analysisPartner.POST("user-place-rank-list", analysishandler.HandleGetUserPlaceAnalysisList)

			// 用户详情数据分析
			analysisPartner.POST("get-user-analysis", stewardapp.GetUserAnalysis) // 用户整体数据分析

			analysisPartner.POST("user-analysis-detail", analysishandler.GetUserAnalysisDetail)       // 用户流水折线图
			analysisPartner.POST("get-user-settlement", analysishandler.GetUserSettlementAnalysis)    // 用户流水折线图
			analysisPartner.POST("get-user-income", analysishandler.GetUserIncomeAnalysis)            // 用户收益折线图
			analysisPartner.POST("get-user-order-total", analysishandler.GetUserPriceAnalysis)        // 用户笔数单价折线图
			analysisPartner.POST("get-user-place-sale", analysishandler.GetUserSaleAnalysis)          // 门店动销混合图
			analysisPartner.POST("get-user-analysis-list", analysishandler.HandleGetUserAnalysisData) // 用户数据分析列表

			// -------------------------------- 门店数据分析 --------------------------------- //
			analysisPartner.POST("place", analysishandler.HandleGetStatisticsPlaceList)                 // 门店统计列表
			analysisPartner.POST("place/no-settlement", analysishandler.HandleGetNoSettlementPlaceList) // 无流水门店

		}
	}

}
